package com.shen.function;

import java.util.function.Consumer;
import java.util.function.Supplier;

public class Demo04 {
    public static void main(String[] args) {
        /**
         * supplier 供给型接口 无参数，返回一个类型值
         */
      /*  Supplier supplier = new Supplier() {
            @Override
            public Object get() {
                return "aaa";
            }
        };*/
        Supplier supplier=()->{
            return "aaa";
        };

        System.out.println(supplier.get());//aaa
    }
}

